import { request } from 'umi';

export async function fakeSubmitForm(params: any) {
  return request('/api/hospitalAttestation/save', {
    method: 'POST',
    data: params,
  });
}

export async function queryDetail(params: any) {
  return request('/api/doctor/' + params.id, {
    method: 'get',
    data: params,
  });
}

//
export async function queryAuthDoctorDetail(params: any) {
  return request('/api/doctorAttestation/' + params.id, {
    method: 'get',
    data: params,
  });
}

export async function approveDoctor(params: any) {
  return request('/api/doctorAttestation/reviewDoctorCertificationInfo', {
    method: 'POST',
    data: params,
  });
}

export async function list(params: any) {
  return request('/api/doctor/page', {
    method: 'POST',
    data: params,
  });
}

export async function authlist(params: any) {
  return request('/api/doctorAttestation/page', {
    method: 'POST',
    data: params,
  });
}

export async function updateStatus(params: any) {
  return request('/api/doctor/status', {
    method: 'POST',
    data: params,
  });
}

export async function updateTop(params: any) {
  return request('/api/doctor/isTop', {
    method: 'POST',
    data: params,
  });
}

/** 修改文章 PUT /api/ */
export async function update(params: any) {
  return request('/api/doctor/edit', {
    method: 'PUT',
    data: params,
  });
}

/** 删除文章 DELETE /api/ */
export async function remove(data: { key: number[] }, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/doctor/' + data.key, {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}
